package com.team.mapper;

import com.team.entity.Patient;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author asus
* @description 针对表【patient(病人表)】的数据库操作Mapper
* @createDate 2024-07-13 14:39:20
* @Entity com.team.entity.Patient
*/
public interface PatientMapper extends BaseMapper<Patient> {
    @Select("select * from patient where id_card = #{idCard}")
    Patient getPatientById(String idCard);
    @Select("select id_medicare from patient where id_card = #{idCard}")
    String hasMedicare(String idCard);
    @Select("select id from patient where id_card = #{idCard}")
    Integer getPatientId(String idCard);
    @Select("select * from patient where id = #{id}")
    Patient getPatient(Integer id);
    @Select("select * from patient where sickroom_id=#{sickroomId} and isout=1")
    List<Patient> getPatientBySickroomId(Integer sickroomId);
    @Update("update patient set isout=2 where id=#{id}")
    int patientOut(Integer id);

}




